#include<stdio.h>
int main()
{
    int n = 0;
    scanf("%d",&n);
    int arr[20]={0};
    int i = 0;
    int sex = 0;
    int h = 0;
    int w = 0;
    int j = 0;
    for(i=0;i<n;i++)
    {
        j = i*2;
        getchar();
        scanf("%d %d %d",&sex,&h,&w);
        if(sex==1)
        {
            if(h<130)
            {
                arr[j]=-1;
            }
            else if(h>130)
            {
                arr[j]=1;
            }
            if(w<27)
            {
                arr[j+1]=-1;
            }
            else if(w>27)
            {
                arr[j+1]=1;
            }
        }
        if(sex==0)
        {
            if(h<129)
            {
                arr[j]=-1;
            }
            else if(h>129)
            {
                arr[j]=1;
            }
            if(w<25)
            {
                arr[j+1]=-1;
            }
            else if(w>25)
            {
                arr[j+1]=1;
            }
        }
    }
    for(i=0;i<n;i++)
    {
        j = i*2;
        switch(arr[j])
        {
            case -1:
                printf("duo chi yu! ");
                break;
            case 1:
                printf("ni li hai! ");
                break;
            case 0:
                printf("wan mei! ");
            default:
                break;
        }
        switch(arr[j+1])
        {
            case -1:
                printf("duo chi rou!\n");
                break;
            case 1:
                printf("shao chi rou!\n");
                break;
            case 0:
                printf("wan mei!\n");
                break;
            default:
                break;
        }
    }
    return 0;
}